package com.shujia.method_.seven;

public class MethodDemo2 {

    // 形参的传递, 值传递
    public static void main(String[] args) {
        int num1 = 10;
        int num2 = 20;
        System.out.println(num1);//10
        System.out.println(num2);//20
        transfer(num1, num2);
        System.out.println(num1);// 10
        System.out.println(num2);// 20
    }

    public static void transfer(int num1, int num2) {
        num1 = num1 ^ num2;
        num2 = num1 ^ num2;
        num1 = num1 ^ num2;
        System.out.println(num1);// 20
        System.out.println(num2);// 10
    }
}
